package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.announcements.domain.Announcements;
import com.zhentao.common.dtos.ResponseResult;
import com.zhentao.service.AnnouncementsService;
import com.zhentao.mapper.AnnouncementsMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86188
* @description 针对表【announcements】的数据库操作Service实现
* @createDate 2024-08-31 10:37:18
*/
@Service
public class AnnouncementsServiceImpl extends ServiceImpl<AnnouncementsMapper, Announcements>
    implements AnnouncementsService{

    @Override
    public ResponseResult indexHomeList() {
        LambdaQueryWrapper<Announcements> wrapper = new LambdaQueryWrapper<>();
                wrapper.eq(Announcements::getStatus, 1);
                wrapper.orderByDesc(Announcements::getCreateTime);
        List<Announcements> list = this.list(wrapper);
        return ResponseResult.okResult(list);
    }
}




